<!--
 * @Author: chenhuanhuan 2925102113@qq.com
 * @Date: 2024-12-11 10:09:37
 * @LastEditors: chenhuanhuan 2925102113@qq.com
 * @LastEditTime: 2025-01-07 11:55:36
 * @FilePath: \hbzc-groupmeal-center-web\src\centerViews\basicInformation\skuManage\skuMatch\index.vue
-->

// SKU匹配，暂不展示
<template>
  <div class="app-container flex flex-col">
    <searchCard>
      <el-form :model="SKUForm" label-width="auto" inline @onSearch="searchFn" @onReset="resetFn">
        <el-form-item label="SKU名称：">
          <pb-input v-modal="SKUForm.name" placeholder="请输入SKU名称"></pb-input>
        </el-form-item>
        <el-form-item label="SKU编码：">
          <pb-input v-modal="SKUForm.code" placeholder="请输入SKU编码"></pb-input>
        </el-form-item>

        <el-form-item label="SPU匹配：">
          <pb-check>全部</pb-check>
          <pb-check checked>未匹配</pb-check>
          <pb-check>匹配</pb-check>
        </el-form-item>
      </el-form>
    </searchCard>

    <div class="flex-1">
      <pb-card padding="0" height="100%">
        <div class="content-box">
          <ContentOperation>
            <pb-button size="small" plain class="mr-6">批量匹配</pb-button>
            <pb-button size="small" plain class="mr-6">导入</pb-button>
            <pb-button size="small" plain>导出</pb-button>
          </ContentOperation>
          <div class="table-box flex">
            <div class="left-tree-box">
              <pb-tree @nodeClick="nodeClick"></pb-tree>
            </div>
            <div class="table-right">
              <pb-table :column="SKUColumn" :tableData="SKUTableData" :bottomElement="['pb-page']">
                <template #operate="{ row }">
                  <pb-button size="small" text>匹配SPU</pb-button>
                  <p class="divider mr-2 ml-2"></p>
                  <pb-button size="small" text>重新匹配</pb-button>
                </template>
              </pb-table>
              <pb-pagination v-model:currentPage="pages.currentPage" v-model:pageSize="pages.pageSize"
                @onChange="onPagesChange" :total="pages.total"></pb-pagination>
            </div>
          </div>
        </div>
      </pb-card>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from "vue-router";
const router = useRouter();

const SKUTableData = reactive([]);
const SKUColumn = reactive([
  {
    key: "SKUCode",
    width: 100,
    name: "SKU编码",
  },
  {
    key: "SKUClassName",
    width: 100,
    name: "SKU类别",
  },
  {
    key: "SKUName",
    name: "SKU名称",
  },
  {
    key: "SKUAliases",
    name: "计量单位",
  },
  {
    key: "fctName",
    name: "规格",
  },
  {
    key: "fctName",
    name: "匹配SPU",
  },
  {
    key: "fctName",
    name: "匹配度",
  },
  {
    key: "fctName",
    name: "匹配方式",
  },
  {
    key: "fctName",
    name: "匹配时间",
  },
  {
    slot: "operate",
    name: "操作",
    width: 200,
    fixed: "right",
  },
]);

const SKUForm = reactive({
  name: "",
  code: "",
  nikeName: "",
});

const pageInit = () => ({
  total: 0,
  currentPage: 1,
  pageSize: 15,
});
const pages = ref(pageInit());
const onPagesChange = () => {
};


const searchFn = () => {
  pages.value.currentPage = 1
};

const resetFn = () => { };

const nodeClick = (data) => {
  console.log(data, 999);
};
</script>

<style lang="scss" scoped>
.content-box {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.table-box {
  flex: 1;
  overflow: hidden;

  .table-right {
    width: 84%;
    height: 100%;
    padding: 16px;
    box-sizing: border-box;
  }
}
</style>
